feat(web): add fact-drift CI gate#3481
Conversation
…ventory (#3415) Extract shared derivation logic into web/scripts/facts-lib.mjs and create a check-facts.mjs CI gate that fails when web/lib/facts.generated.ts is stale relative to the workspace sources. - facts-lib.mjs: single-source-of-truth derivation shared by derive-facts.mjs (prebuild) and check-facts.mjs (gate) - derive-facts.mjs: slimmed to ~63 lines, imports from facts-lib.mjs - check-facts.mjs: re-derives facts and compares against committed file; exits non-zero when version, providers, crates, sandboxBackends, defaultModel, nodeEngines, toolCount, or license have drifted - web/package.json: add npm run check:facts script - .github/workflows/web.yml: run check:facts after prebuild in lint job - web/lib/check-facts.test.ts: 9 vitest tests covering stale version (0.8.62 vs 0.8.64), provider drift, multi-field detection, edge cases Closes #3415
|
Claude finished @Hmbown's task in 4m 17s —— View job Code Review — PR #3481
Overall: The extraction into [Bug — CI gate is a no-op]
- name: Generate derived facts
run: npm run prebuild # ← OVERWRITES facts.generated.ts
- name: Check facts drift
run: npm run check:facts # ← compares freshly-written file to freshly-derived facts
Fix: swap the two steps so the drift check reads the committed file before - name: Check facts drift # sees the committed file
run: npm run check:facts
- name: Generate derived facts # regenerates for tsc
run: npm run prebuild[Moderate —
|
Summary
Closes #3415.
Supersedes #3473.
Verification